<!-- BEGIN: PAGECONTENT -->
        <script type="text/javascript">
			$(document).ready(function() {
			    //validate signup form on keyup and submit
			    $("#admin_form").validate({
			        rules: {
			            Title: {
			                required: true,
			                maxlength: 70
			            }
			        },
			        messages: {
			            Title: {
			                required: "Tiêu đề không được phép để chống",
			                maxlength: "Tiêu đề không nên dài quá 70 ký tự"
			            }
			        }
			    });
			    
			    // Initialise FancyBox Modal window:
			    $("a.fancy").fancybox({
			        'titlePosition' : 'inside'
			    });
			    
			 	// set file type
			    setFileType();
			    
			    $('#ImageLink').change(function() {
			    	setFileType();
		    	});
			});
		</script>
		<style type="text/css">
		    #admin_form label.error { width: 100%; color:red; margin-top:5px;}
		</style>
        <script type="text/javascript">
            function BrowseServer()
            {
                var finder = new CKFinder();
                finder.basePath = 'images/';
                finder.selectActionFunction = SetFileField;
                finder.popup();
            }
            
         	// This is a sample function which is called when a file is selected in CKFinder.
            function SetFileField( fileUrl )
            {
            	$("#ImageLink").val(fileUrl);
            	setFileType();
            }
			
            function setFileType(){
            	var imageLink = $("#ImageLink").val();
            	
            	if (imageLink.length > 0){
            			$('div#over-view').html("<a href=\""+imageLink +"\" class=\"fancy\" rel=\"group\" id=\"upload-img-fancy\"><img src=\""+imageLink +"\" id=\"upload-img\" style=\"max-height: 250px;\"></a>");
            			// Initialise FancyBox Modal window:
        			    $("a.fancy").fancybox({
        			        'titlePosition' : 'inside'
        			    });
            	} else {
                	$('div#over-view').html("");
            	}
            }
        </script>
        <div class="form-content-page">
            <section>
			        <form class="block-content form" id="admin_form" method="post" action="submit.php?ctrl={CONTROLLER}&act={ACTION}">
			            <h2>{FORMTITLE}</h2>
			            <!-- BEGIN: ITEM -->
                        <fieldset>
                            <legend>
                                Thông tin sản phẩm
                            </legend>
                            <input type="hidden" name="ID" id="ID" value="{ITEM.ID}">
                            <input type="hidden" name="Type" id="Type" value="{ITEM.Type}">
                            <div class="columns">
                                <div class="colx2-left">
                                	<p>
                                		<label for="simple-required">Tên sản phẩm</label>
                                		<input type="text" name="Title" id="Title" value="{ITEM.Title}" class="full-width">
		                            </p>
		                            <p>
		                                <label for="simple-required">Mã sản phẩm</label>
		                                <input type="text" name="ProductCode" id="ProductCode" value="{ITEM.ProductCode}" class="full-width">
		                            </p>
		                            <p>
		                                <label for="simple-required">Danh mục sản phẩm:</label>
		                                {ITEM.CategoryID}
		                            </p>
		                            <p>
		                                <label for="simple-required">Hãng sản xuất: </label>
		                                <input type="text" name="Manufacturer" id="Manufacturer" value="{ITEM.Manufacturer}" class="full-width">
		                            </p>
		                            <p>
		                                <label for="simple-required">Tình trạng sản phẩm: </label>
		                                <input type="text" name="Status" id="Status" value="{ITEM.Status}" class="full-width">
		                            </p>
                                </div>
                                <div class="colx2-right">
                                    <div class="imageBox">
		                                <label for="ImageLink">Ảnh đại diện:</label>
		                                <div style="width: 100%" align="center" id="over-view">
			                               <a href="{ITEM.ImageLink}" class="fancy" rel="group" id="fancyLogoLink"><img src="{ITEM.ImageLink}" style="max-height: 250px;"></a>
			                            </div>
			                            <br /> 
		                                <input type="text" name="ImageLink" id="ImageLink" value="{ITEM.ImageLink}" class="half-width">
		                                &nbsp;&nbsp; <button type="button" class="grey browser-file" onclick="BrowseServer();">Chọn ảnh</button>
		                            </div>
                                </div>
                            </div>
                            <div class="columns">
                                <div class="colx2-left">
                                	<p>
		                                <label for="simple-required">Chính sách bảo hành: </label>
		                                <input type="text" name="Warranty" id="Warranty" value="{ITEM.Warranty}" class="full-width">
		                            </p>  
		                            <p>
		                                <label for="simple-required">Số lượng sản phẩm: </label>
		                                <input type="text" name="Quantity" id="Quantity" value="{ITEM.Quantity}" class="full-width">
		                            </p>
                                </div>
                                <div class="colx2-right">
                                    <p>
		                                <label for="simple-required">Màu sắc sản phẩm: </label>
		                                <input type="text" name="Color" id="Color" value="{ITEM.Color}" class="full-width">
		                            </p>  
		                            <p>
		                                <label for="simple-required">Kích cớ sản phẩm: </label>
		                                <input type="text" name="Size" id="Size" value="{ITEM.Size}" class="full-width">
		                            </p>
                                </div>
                            </div>
                            <div class="columns">
                                <div class="colx2-left">
                                	<p>
                                    	<label for="simple-required">Giá niêm yết</label>
                                    	<input type="text" name="ShowPrice" id="ShowPrice" value="{ITEM.ShowPrice}" class="full-width">
                                    </p>
                                    <p>
                                    	<label for="simple-required">Giá bán</label>
                                    	<input type="text" name="Price" id="Price" value="{ITEM.Price}" class="full-width">
                                    </p>
                                </div>
                                <div class="colx2-right">
                                    <p>
                                    	<label for="simple-required">Loại tiền tệ</label>
                                    	{ITEM.ShowCurrency}
                                    </p>
                                    <p>
                                    	<label for="simple-required">Loại tiền tệ</label>
                                    	{ITEM.Currency}
                                    </p>
                                </div>
                            </div>
                            <p>
                                <label for="simple-required">Khuyến mại</label>
                                <textarea name="Promotion" id="Promotion" class="full-width height-100">{ITEM.Promotion}</textarea>
                            </p>                            
                            <p>
                                <label for="simple-required">Tính năng nổi bật (hiển thi trên page view)</label>
                                <textarea name="HotFeature" id="HotFeature" class="full-width height-100">{ITEM.HotFeature}</textarea>
                                <script type="text/javascript">
                                        //<![CDATA[
                    
                                        var HotFeatureEditor = CKEDITOR.replace('HotFeature', {
                                            skin : 'v2',
                                            removePlugins : 'resize',
                                            extraPlugins : 'autogrow',
                                            toolbar :
                                            [
                                                ['Source','-','Undo','Redo','-','Copy','Paste'],
                                                ['FontSize','TextColor', 'Bold', 'Italic','Underline'],
                                                ['Format','Link','-','Unlink'],
                                            ]
                                        });
                    
                                        //]]>
                                </script>
                            </p>
                            <p>
                                <label for="simple-required"><b>Miêu tả sản phẩm</b></label>
                                <textarea name="Content" id="Content" class="full-width">{ITEM.Content}</textarea>
                                <script type="text/javascript">
                                    //<![CDATA[
                                    var editorContent = CKEDITOR.replace('Content', {
                                        skin : 'v2',
                                        removePlugins : 'resize',
                                        extraPlugins : 'autogrow'
                                    });
                                    CKFinder.setupCKEditor( editorContent, 'content/ckfinder/' ) ;
                                    //]]>
                                </script>
                            </p>
                           <p>
                                <label for="simple-required"><b>Đặc tính kỹ thuật của sản phẩm</b></label>
                                <textarea name="Specifications" id="Specifications" class="full-width">{ITEM.Specifications}</textarea>
                                <script type="text/javascript">
                                    //<![CDATA[
                                    var editorSpecifications = CKEDITOR.replace('Specifications', {
                                        skin : 'v2',
                                        removePlugins : 'resize',
                                        extraPlugins : 'autogrow'
                                    });
                                    CKFinder.setupCKEditor( editorSpecifications, 'content/ckfinder/' ) ;
                                    //]]>
                                </script>
                            </p>
                        </fieldset>
                        <fieldset>
                            <legend>
                                Nội dung SEO
                            </legend>
                            <div class="columns">
                                <div class="colx2-left">
                                	<p>
					                    <label for="TitleTag">Thẻ Title:</label>
					                    <input type="text" name="TitleTag" id="TitleTag" value="{ITEM.TitleTag}" class="full-width">
					                </p>
					                <p>
					                    <label for="URL">Đường dẫn URL: (chỉ chứa các chữ cái không dấu và dấu gách ngang "-")</label>
					                    <input type="text" name="URL" id="URL" value="{ITEM.URL}" class="full-width">
					                </p>
					                <p>
					                    <label for="MetaKeyword">Meta Keyword: (các từ khóa ngăn cách nhau bằng dấu phẩy ",")</label>
					                    <input type="text" name="MetaKeyword" id="MetaKeyword" value="{ITEM.MetaKeyword}" class="full-width">
					                </p>
                                </div>
                                <div class="colx2-right">
                                    <p>
		                                <label for="simple-required">Sản phẩm nổi bật</label>
		                                {ITEM.Hot}
		                            </p>
		                            <p>
		                                <label for="simple-required">Sản phẩm mới</label>
		                                {ITEM.Fesh}
		                            </p>
                                </div>
                            </div>
			                <p>
			                    <label for="MetaDescription">Meta Description:</label>
			                    <textarea name="MetaDescription" id="MetaDescription" class="full-width height-100">{ITEM.MetaDescription}</textarea>
			                </p>
                        </fieldset>
                        <fieldset class="grey-bg no-margin">
                            <p class="input-with-button" align="center">
                                <button type="submit">
                                    Hoàn thành
                                </button>
                                <a href="maincontent.php?ctrl={CONTROLLER}&act=view-table"> 
                                    <button type="button">
                                        Hủy bỏ
                                    </button> 
                                </a>
                            </p>
                        </fieldset>
                        <!-- BEGIN: ITEM -->
			        </form>
			</section>
        </div>
<!-- END: PAGECONTENT -->